
//--------------------------------------------------------------------------------------
// register the function
var newRegisteryMarketDataTable = new Array("getMarketPrices", "drawMarketDataTable" );
allJsonsRegistry = allJsonsRegistry.concat(newRegisteryMarketDataTable);

//--------------------------------------------------------------------------------------
// implement the function
// final function that builds the market table from the json object
function drawMarketDataTable(marketDataDictionary) 
{
	var data = new google.visualization.DataTable();
	data.addColumn('string', 'Asset');
	data.addColumn('number', 'Market Price (c$)');
	data.addRows(marketDataDictionary.priceList.length);
	for (var i = 0; i < marketDataDictionary.priceList.length; i++)
	{
		data.setCell(i, 0, marketDataDictionary.priceList[i].assetName );
		data.setCell(i, 1, Math.round( 100 * marketDataDictionary.priceList[i].price ) / 100 );
	}

	var table = new google.visualization.Table(document.getElementById('marketTable_div'));	
	table.draw(data, {width: 200, title: 'Market Prices'});
};